package com.yoga.manager.smsUtil;

import com.yoga.common.enumcommon.SmsBusinessEnum;
import com.yoga.manager.uitl.DateUtil;

import java.util.UUID;

/**
 * Created by chenjin on 2020/3/12.
 */
public class CodeUtil {


    /**
     * length  长度
     *
     * */
    public static String getCode(SmsBusinessEnum captchaTypeEnum){

        int length=6;
        switch (captchaTypeEnum){
            case PHONE_REGISTER:
                length=6;
                break;
            case  BINDING_PHONE:
                length=4;
                break;
        }

      return   DateUtil.getRandoms(length);
    }


    public static String getUserToken(){
        return UUID.randomUUID().toString();
    }

    public static void main(String[] args) {
        System.out.println(CodeUtil.getUserToken());
    }
}
